how to find nested if else in java